package com.gyh.system.sys.web;

import java.util.HashSet;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gyh.system.common.persistence.BaseController;
import com.gyh.system.common.tools.ModuleTree;
import com.gyh.system.common.utils.R;
import com.gyh.system.common.utils.TreeUtils;
import com.gyh.system.sys.entity.Permission;
import com.gyh.system.sys.service.PermissionService;

/**
* @author 作者 gyh:
* @version 创建时间：2018年1月14日 下午8:41:59
* 
*/
@RestController
@RequestMapping(value="/sys/permission")
public class PermissionController extends BaseController{
	
	@Autowired
	private PermissionService permissionService;
	
	@GetMapping
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public R getAllPermissions() {
		List<Permission> list = permissionService.findAllList();
		//List<ModuleTree> treeList = TreeUtils.toListTree(list);
		return R.ok(list);
	}
	
	

}
